package 力扣_二分查找.旋转数组系列.特例;

/**
 * @author zx
 * @create 2023-02-15 0:03
 */
public class 寻找旋转排序数组中的最小值II_154 {
    public int findMin(int[] nums) {
        int left = 0, right = nums.length - 1;
        while(left <= right) {
            int mid = left + ((right - left) >> 1);
            if(nums[mid] < nums[right]) {
                right = mid;
            }else if(nums[mid] > nums[right]){
                left = mid + 1;
            }else if(nums[mid] == nums[right]){
                right--;
            }
        }
        return nums[left];
    }
}
